function y = respond(file,x)
set_param([file,'/KP'],'value',num2str(x(1)));%设定PID参数
set_param([file,'/KI'],'value',num2str(x(2)));
set_param([file,'/KD'],'value',num2str(x(3)));
result = sim([file,'.slx'],[0 50]);%跑一遍simulink并读取结果

p = result.ScopeData1.signals.values;%压力
t = result.tout;%时间

set_point = str2double(get_param([file,'/goal'],'value'));%控制目标值

S = stepinfo(p,t,set_point);
stable_time = S.TransientTime;%调整时间 这个毫无疑问是一个优化目标！
it = find(abs(t-stable_time)<0.1);
ave_error = mean(abs(p(it(end):end)-set_point));%稳态误差
peak = S.Peak;
y  = [1/ave_error 1/stable_time];
end